package oop3.pet;

//父类：宠物的共性
public abstract class Pet {
	protected String name;
	private int health;
	private int love;

	public Pet(int health, int love) {
		super();
		this.health = health;
		this.love = love;
	}

	public Pet(String name, int health, int love) {
		super();
		this.name = name;
		this.health = health;
		this.love = love;
	}

	public void show() {
		System.out.println("这个宠物叫" + name + ",可爱度：" + love + ",健康度：" + health);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getHealth() {
		return health;
	}

	public void setHealth(int health) {
		this.health = health;
	}

	public int getLove() {
		return love;
	}

	public void setLove(int love) {
		this.love = love;
	}

	// 叫声
	public abstract void cry();

	@Override
	public String toString() {

		return " 名字：" + name + ",健康值：" + this.health + ",可爱:" + this.love + " ";
	}
}
